using MediatR;
using RBAC.ErrorCode;
using System;
using System.Collections.Generic;

namespace RBAC.Write.Api.Application.Command.ERP.PurchasingManagement.PurchaseOrders
{
    /// <summary>
    /// 编辑采购订单（主表+可选明细重置）
    /// </summary>
    public class UpdatePurchaseOrderCommand : IRequest<APIResult<int>>
    {
        public long Id { get; set; }

        // 主表可编辑字段
        public string DocCode { get; set; }
        public string BizType { get; set; }
        public string Operatorer { get; set; }
        public string supplierId { get; set; }
        public DateTime docDate { get; set; }
        public string docType { get; set; }
        public DateTime arrivalDate { get; set; }
        public string docStatus { get; set; }
        public string purchaseDept { get; set; }
        public DateTime auditDate { get; set; }
        public string contractUpload { get; set; }
        public string bizStatus { get; set; }
        public string purchaser { get; set; }
        public string materialDemand { get; set; }
        public string contractNo { get; set; }
        public string remark { get; set; }

        /// <summary>
        /// 若提供则重置明细（先删后插）。不提供则仅改主表。
        /// </summary>
        public List<PurchaseOrderDetailDto>? Details { get; set; }
    }
}
